package com.itheima;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

//@Slf4j
public class Topic70 {

    public int climbStairs(int n) {
        int cnt = 0;

        int[] a = new int[n + 1];


        if(n == 1) {
            return 1;
        }
        a[1] = 1;
        a[2] = 2;
        for(int i = 3; i <= n; i++) {
            a[i] = Math.max(a[i - 1] + 1, a[i - 2] + 2);
        }
//        log.info("{}", a[n]);
//        System.out.println(a[n]);

        return a[n];
    }


    @Test
    public void test() {
        System.out.println(climbStairs(4));
    }
}
